package com.grass.p019lv.novel.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.core.view.ViewCompat;
import com.androidsa.bttsddka.R;
import com.grass.p019lv.bean.SearchNovelHotWordsBean;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;

/* renamed from: com.grass.lv.novel.adapter.AdapterNovelSearchRecommend */
public class AdapterNovelSearchRecommend extends BaseAdapter {
    Context mContext;
    List<SearchNovelHotWordsBean> mList = new ArrayList();

    public long getItemId(int i) {
        return (long) i;
    }

    public AdapterNovelSearchRecommend(Context context) {
        this.mContext = context;
    }

    public void setList(List<SearchNovelHotWordsBean> list) {
        this.mList = list;
        notifyDataSetChanged();
    }

    public int getCount() {
        return this.mList.size();
    }

    public SearchNovelHotWordsBean getItem(int i) {
        return this.mList.get(i);
    }

    public View getView(int i, View view, ViewGroup viewGroup) {
        ViewHolder viewHolder;
        if (view == null) {
            view = LayoutInflater.from(this.mContext).inflate(R.layout.item_search_novel_recommend, viewGroup, false);
            viewHolder = new ViewHolder();
            viewHolder.tv_title = (TextView) view.findViewById(R.id.tv_title);
            viewHolder.tv_no = (TextView) view.findViewById(R.id.tv_no);
            view.setTag(viewHolder);
        } else {
            viewHolder = (ViewHolder) view.getTag();
        }
        int nextInt = new Random().nextInt(ViewCompat.MEASURED_SIZE_MASK) | ViewCompat.MEASURED_STATE_MASK;
        viewHolder.tv_title.setText(this.mList.get(i).getHotWordName());
        viewHolder.tv_title.setTextColor(nextInt);
        return view;
    }

    /* renamed from: com.grass.lv.novel.adapter.AdapterNovelSearchRecommend$ViewHolder */
    class ViewHolder {
        ImageView iv_hot;
        TextView tv_no;
        TextView tv_title;

        ViewHolder() {
        }
    }
}
